<?php require 'gauche.tpl.php';?>
	<div id="content">
	    <div>
	        <h2>Statistiques de <?php echo $nickName?></h2>
	        <table class="stats">
	           <tr>
	               <th>Nom</th>
	               <th>Batailles</th>
	               <th>WinRate</th>
	               <th>Survie</th>
	               <th>Dégâts moy.</th>
	               <th>Exp. moy.</th>
	               <th>Cap moy.</th>
	               <th>Def Moy.</th>
	               <th>Kill moy.</th>
	               <th>Kill/Death</th>
	               <th>Tier moy.</th>
	               <th>ER</th>
	               <th>WN7</th>
	               <th>WN8</th>
	               
               </tr>
	        <?php $i=0;
	            foreach ($listeTanks as $stats) {
$i++;
                $class='';
                if ($i % 2 === 0) {
                    $class = 'class="paire"';
                }
	        ?>
            
	           <tr <?php echo $class?>>
	               <td><?php echo $stats['name']?></td>
	               <td><?php echo number_format($stats['all']['battles'], 0, ', ',' ')?></td>
	               <?php if($stats['all']['battles'] > 0) {?>
	               <td><?php echo number_format($stats['all']['wins']/$stats['all']['battles']*100, 2, ',',' ')?> %</td>
	               <?php }else {?>
	               <td>0</td>
	               <?php }?>
	               <?php if($stats['all']['battles'] > 0) {?>
	               <td><?php echo number_format($stats['all']['survived_battles']/$stats['all']['battles']*100, 2, ',' ,' ')?> %</td>
	               <?php }else {?>
	               <td>0</td>
	               <?php }?>
	               <?php if($stats['all']['battles'] > 0) {?>
	               <td><?php echo number_format($stats['all']['damage_dealt']/$stats['all']['battles'], 2, ',',' ')?></td>
	               <?php }else {?>
	               <td>0</td>
	               <?php }?>
	               <?php if($stats['all']['battles'] > 0) {?>
	               <td><?php echo number_format($stats['all']['xp']/$stats['all']['battles'], 2, ',' ,' ')?></td>
	               <?php }else {?>
	               <td>0</td>
	               <?php }?>
	               <?php if($stats['all']['battles'] > 0) {?>
	               <td><?php echo number_format($stats['all']['capture_points']/$stats['all']['battles'], 2, ',' ,' ')?></td>
	               <?php }else {?>
	               <td>0</td>
	               <?php }?>
	               <?php if($stats['all']['battles'] > 0) {?>
	               <td><?php echo number_format($stats['all']['dropped_capture_points']/$stats['all']['battles'], 2, ',' ,' ')?></td>
	               <?php }else {?>
	               <td>0</td>
	               <?php }?>
	               <?php if($stats['all']['battles'] > 0) {?>
	               <td><?php echo number_format($stats['all']['frags']/$stats['all']['battles'], 2, ',' ,' ')?></td>
	               <?php }else {?>
	               <td>0</td>
	               <?php }?>
	               <?php if($stats['all']['battles']- $stats['all']['survived_battles'] > 0) {?>
	               <td><?php echo number_format($stats['all']['frags']/($stats['all']['battles']-$stats['all']['survived_battles']), 2, ',' ,' ')?></td>
	               <?php }else {?>
	               <td>0</td>
	               <?php }?>
	               <td><?php echo $stats['all']['tiers']?></td>
	               <td class="<?php echo $stats['ER_status']?>"><?php echo $stats['ER']?></td>
	               <td class="<?php echo $stats['WN7_status']?>"><?php echo $stats['WN7']?></td>
	               <td class="<?php echo $stats['WN8_status']?>"><?php echo $stats['WN8']?></td>
               </tr>
	        <?php }?>
	        </table>
		</div>
		
	</div>